package com.zhxy.util.web;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest;

@SuppressWarnings("rawtypes")
public abstract class ServletRequestAdapter implements ServletRequest {

	@Override
	public Object getAttribute(String name) {
		return getServletRequest().getAttribute(name);
	}

	@Override
	public Enumeration getAttributeNames() {
		return getServletRequest().getAttributeNames();
	}

	@Override
	public String getCharacterEncoding() {
		return getServletRequest().getCharacterEncoding();
	}

	@Override
	public void setCharacterEncoding(String env)
			throws UnsupportedEncodingException {
		getServletRequest().setCharacterEncoding(env);
	}

	@Override
	public int getContentLength() {
		return getServletRequest().getContentLength();
	}

	@Override
	public String getContentType() {
		return getServletRequest().getContentType();
	}

	@Override
	public ServletInputStream getInputStream() throws IOException {
		return getServletRequest().getInputStream();
	}

	@Override
	public String getParameter(String name) {
		return getServletRequest().getParameter(name);
	}

	@Override
	public Enumeration getParameterNames() {
		return getServletRequest().getParameterNames();
	}

	@Override
	public String[] getParameterValues(String name) {
		return getServletRequest().getParameterValues(name);
	}

	@Override
	public Map getParameterMap() {
		return getServletRequest().getParameterMap();
	}

	@Override
	public String getProtocol() {
		return getServletRequest().getProtocol();
	}

	@Override
	public String getScheme() {
		return getServletRequest().getScheme();
	}

	@Override
	public String getServerName() {
		return getServletRequest().getServerName();
	}

	@Override
	public int getServerPort() {
		return getServletRequest().getServerPort();
	}

	@Override
	public BufferedReader getReader() throws IOException {
		return getServletRequest().getReader();
	}

	@Override
	public String getRemoteAddr() {
		return getServletRequest().getRemoteAddr();
	}

	@Override
	public String getRemoteHost() {
		return getServletRequest().getRemoteHost();
	}

	@Override
	public void setAttribute(String name, Object o) {
		getServletRequest().setAttribute(name, o);
	}

	@Override
	public void removeAttribute(String name) {
		getServletRequest().removeAttribute(name);
	}

	@Override
	public Locale getLocale() {
		return getServletRequest().getLocale();
	}

	@Override
	public Enumeration getLocales() {
		return getServletRequest().getLocales();
	}

	@Override
	public boolean isSecure() {
		return getServletRequest().isSecure();
	}

	@Override
	public RequestDispatcher getRequestDispatcher(String path) {
		return getServletRequest().getRequestDispatcher(path);
	}

	@SuppressWarnings("deprecation")
	@Override
	public String getRealPath(String path) {
		return getServletRequest().getRealPath(path);
	}

	@Override
	public int getRemotePort() {
		return getServletRequest().getRemotePort();
	}

	@Override
	public String getLocalName() {
		return getServletRequest().getLocalName();
	}

	@Override
	public String getLocalAddr() {
		return getServletRequest().getLocalAddr();
	}

	@Override
	public int getLocalPort() {
		return getServletRequest().getLocalPort();
	}

	protected abstract ServletRequest getServletRequest();
}
